<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->increments('id');
            $table->string('code',20);
            $table->timestamp('auto_unlock_datetime')->nullable();
            $table->string('cinema_code',20);
            $table->string('cinema_name',20);
            $table->integer('cinema_status');
            $table->string('screen_code',20);
            $table->string('screen_name',20);
            $table->string('showtime_schedule_code',20);
            $table->string('showtime_schedule_name',20);
            $table->integer('from')->default(1);
            $table->timestamp('start_time')->nullable();
            $table->timestamp('end_time')->nullable();
            $table->integer('playthrough_flag');
            $table->string('print_no',50)->nullable();
            $table->timestamp('print_time')->nullable();
            $table->string('verify_code',50)->nullable();
            $table->text('films');
            $table->integer('channel_id')->default(0);
            $table->integer('seat_by_number');
            $table->integer('status')->default(1);
            $table->timestamp('last_modify')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
